# Maintainer: Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Kritoke <kritoke@nospam.gmail.com>

pkgname=gnome-nettool
pkgver=3.8.1+205+g8550eef
pkgrel=3
pkgdesc="Graphical interface for various networking tools"
url="https://git.gnome.org/browse/gnome-nettool"
arch=(x86_64)
license=(GPL)
depends=(gtk3 libgtop ldns iputils dconf whois)
makedepends=(nmap net-tools git meson itstool)
optdepends=('nmap: Port scanning'
            'net-tools: Network statistics')
groups=(gnome-extra)
_commit=8550eef45eb228fb4a4c816bde33ec24da0aa06e  # master
source=("git+https://git.gnome.org/browse/gnome-nettool#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^gnome-nettool-//;s/-/./;s/-/./;s/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build
  ninja -C build
}

check() {
  cd build
  meson test
}

package() {
  DESTDIR="$pkgdir" ninja -C build install
}
